Global Index
HTML5 JS API Index > File API Tutorials & Specs

FileWriterSync

This interface lets users write, truncate, and append to files using simple synchronous calls.

Properties
unsigned long long
length
The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
unsigned long long
position
The byte offset at which the next write to the file will occur. This must be no greater than length.
Operations
void
seek(long long offset)
Seek sets the file position at which the next write will occur.
void
truncate(unsigned long long size)
Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
void
write(Blob data)
Write the supplied data to the file at position. Upon completion, position will increase by data.size.
Referenced by
FileEntrySynccreateWriter()